/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session08;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author sinhnx <sinhnx@fpt.aptech.ac.vn>
 */
public class HelloClient {

    public static void main(String[] args) {
        String str = "rmi://localhost:1099/HelloServer";
        try {
            IHello hello = (IHello) Naming.lookup(str);
            System.out.println(hello.sayHello(args[0]));
        } catch (NotBoundException ex) {
            Logger.getLogger(HelloClient.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(HelloClient.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            Logger.getLogger(HelloClient.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
}
